<script setup lang="ts">
import type { MenuItem } from 'my-web-core/models';

defineProps<{ menuItems: MenuItem[] }>();
</script>

<template>
  <template v-for="item in menuItems">
    <template v-if="item.children?.length">
      <el-sub-menu :index="item.route">
        <template #title>
          <span>{{ item.title }}</span>
        </template>
        <MenuItemList :menu-items="item.children" />
      </el-sub-menu>
    </template>
    <template v-else>
      <el-menu-item :index="item.route">
        <template #title>{{ item.title }}</template>
      </el-menu-item>
    </template>
  </template>
</template>

<style scoped></style>
